home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.3 Development Libraries / SGI IRIX 6.3 Development Libraries.iso / dist6.3 / gl_dev.idb / usr / share / src / OpenGL / demos / stonehenge / TimeDate.h.z / TimeDate.h
Encoding:
C/C++ Source or Header  |  1996-12-06  |  925 b   |  41 lines

  1. #ifndef TIMEDATE_H
  2. #define TIMEDATE_H
  3.  
  4. #include "Point.h"
  5.  
  6. #include <time.h>
  7.  
  8. class TimeDate {
  9.  public:
  10.   TimeDate() {};
  11.   TimeDate(int hour, int minute = 0, int second = 0, long usecond = 0);
  12.   TimeDate(struct tm t2) {t = t2;};
  13.   
  14.   TimeDate operator=(TimeDate a);
  15.   TimeDate operator+(TimeDate a);
  16.   TimeDate operator+(struct tm t2);
  17.   TimeDate operator+=(TimeDate a);
  18.   TimeDate operator-(TimeDate a);
  19.   TimeDate operator*(float f);
  20.  
  21.   /* This reads the current clock time and returns itself */
  22.   TimeDate read_time();
  23.  
  24.   void print();
  25.  
  26.   Point sun_direction(float lon = -93, float lat = 45);
  27.  private:
  28.   /* Call this if the time can only have gotten bigger */
  29.   TimeDate correct_bigger();
  30.   /* Call this if the time could have gotten bigger or smaller */
  31.   TimeDate correct_smaller();
  32.  
  33.   struct tm t;
  34.   /* This won't be quite accurate down to microseconds, but should be
  35.    * reasonably close */
  36.   long usec;
  37. };
  38.  
  39. #endif
  40.  
  41.